package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 游记评论表
 */
@Setter
@Getter
@JsonIgnoreProperties("handler")
public class TravelComment {
    public static final int COMMENT_SUCCESS = 1;//成功
    public static final int COMMENT_FAIL = 0; //失败
    public static final int COMMENT_WAITTING = 2; //正在审核
    private Long id; //评论ID

    private Travel travel; //被评论的游记

    private User reviewer; //评论者
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime; //评论的时间

    private Integer state = COMMENT_FAIL; //评论的状态 1表示评论成功,0表示评论失败 2.表示评论正在审核

    private String content; //评论的内容

    private Integer greatCount =0; //该评论的点赞数量,初始化就是0次
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatetime; //更新时间
    //游记的所有回复评论
    private List<CommentReply> replies = new ArrayList<>();

}